package com.example.xunai.config;

public class CacheConstants {

    // 对话相关缓存
    public static final String CONVERSATION_KEY_PREFIX = "conversation:%s";
    public static final String CONVERSATION_MESSAGES_KEY_PREFIX = "conversation:%s:messages";

    // 流式对话缓存
    public static final String STREAMING_MESSAGES_KEY_PREFIX = "streaming:%s";

    // 异步请求缓存
    public static final String REQUEST_STATUS_KEY_PREFIX = "request:%s:status";
    public static final String REQUEST_RESPONSE_KEY_PREFIX = "request:%s:response";

    // Token使用统计缓存
    public static final String TOKEN_STATS_KEY_PREFIX = "token:stats:%s:%s"; // token:stats:userId:date
    public static final String TOKEN_TREND_KEY_PREFIX = "token:trend:%s:%s"; // token:trend:userId:days

    // 模型配置缓存
    public static final String MODEL_CONFIG_KEY = "model:config";
    public static final String SUPPORTED_MODELS_KEY = "models:supported";

    // 缓存TTL配置（秒）
    public static final long CONVERSATION_TTL = 30 * 60; // 30分钟
    public static final long STREAMING_TTL = 5 * 60;     // 5分钟
    public static final long REQUEST_TTL = 30 * 60;      // 30分钟
    public static final long TOKEN_STATS_TTL = 24 * 60 * 60; // 24小时
    public static final long MODEL_CONFIG_TTL = 60 * 60; // 1小时
}